﻿namespace Framework.Code.FlowWork;

/// <summary>
/// 流程节点
/// </summary>
public class FlowNode
{
    /// <summary>
    /// 节点类型（1-发起人节点；2-网关节点；3-条件节点；4-审批人节点）
    /// </summary>
    public int nodeType { get; set; }
    /// <summary>
    /// 节点展示名称
    /// </summary>
    public string? nodeDisplayName { get; set; }
    /// <summary>
    /// 节点标题名称
    /// </summary>
    public string? nodeName { get; set; }

    /// <summary>
    /// 节点id
    /// </summary>
    public string nodeId { get; set; }

    /// <summary>
    /// 前一个节点
    /// </summary>
    public List<string> prevId { get; set; }

    /// <summary>
    /// 前一个节点
    /// </summary>
    public string nodeFrom { get; set; }

    /// <summary>
    /// 下一个节点
    /// </summary>
    public List<string> nodeTo { get; set; }

    /// <summary>
    /// 节点属性（1-没有属性；2-层层审批；3-指定层级审批；4-指定角色；5-指定人员；6-HRBP；7-自选模块；8-关联配置表）
    /// </summary>
    public int nodeProperty { get; set; }

    /// <summary>
    /// 节点审批状态
    /// </summary>
    public int FlowNodeStatus { get; set; }

    /// <summary>
    /// 节点属性
    /// </summary>
    public NodeProperty properties { get; set; }
}
/// <summary>
/// 节点的属性
/// </summary>
public class NodeProperty
{
    public string? title { get; set; }
    public List<approversConf>? approvers { get; set; }
    public List<conditionsConf>? conditions { get; set; }
    public string? assigneeType { get; set; }
    public bool? counterSign { get; set; }
    public bool? optionalMultiUser { get; set; }
    public string? optionalRange { get; set; }
    public string? initiator { get; set; }
    public string? priority { get; set; }
    public bool? isDefault { get; set; }
}

public class approversConf
{
    public string? formId { get; set; }
    public string? key { get; set; }
    public string? value { get; set; }
    public string? valueDisplay { get; set; }

    /// <summary> form种的字段名称 </summary>
    public string? fieldName { get; set; }

    /// <summary> 字段类型："form"：为表单中的字段，后期扩展系统表等. </summary>
    public string fieldType { get; set; }
}

public class conditionsConf
{
    public string? formId { get; set; }
    public List<conditionsChild>? conditionValue { get; set; }
}

public class conditionsChild
{
    public string? key { get; set; }
    public string? value { get; set; }
    public string? valueDisplay { get; set; }

    /// <summary> form种的字段名称 </summary>
    public string? fieldName { get; set; }

    /// <summary> 字段类型："form"：为表单中的字段，后期扩展系统表等. </summary>
    public string? fieldType { get; set; }
}